<template>
  <div class="home">
    <!-- 搜索框 -->
    <van-search v-model="value" placeholder="请输入搜索关键词" disabled 
      @click="$router.push('/home/searchPopup')"
    />
    <!-- 轮播图 -->
    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
      <van-swipe-item v-for="item in banner" :key="item.id" >
        <img :src="item.image_url" width="100%" alt="">
      </van-swipe-item>
    </van-swipe>
    <transition name="van-slide-right">
      <router-view></router-view>
    </transition>
    
    </div>
</template>

<script>
import { GetHomeData } from "@/request/api";
export default {
  name: "Home",
  components: {},
  data() {
    return {
      value: "",
      banner:[],
    };
  },
  created() {
    GetHomeData()
      .then((res) => {
        this.banner = res.data.banner;
      })
      .catch((err) => {
        console.log(err);
      });
  },
};
</script>




